import binascii


def ip2b(ip):
    return "".join(binascii.hexlify(bytes(int(t))) for t in ip.split("."))


# 示例使用
ip_address = "192.168.1.1"
print(ip2b(ip_address))
